//
// Created by zhuyijun on 2021/9/17.
//

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;

int main() {
    ifstream fin;
    fin.open("tobuy.txt");
    if (fin.is_open() == false){
        cerr <<"Can't open file. Bye.\n";
        exit(EXIT_FAILURE);
    }
    string item;
    int count = 0;
    getline(fin,item,':');
    while (fin){
        ++count;
        cout<<count<<": "<<item<<endl;
        getline(fin,item,':');
    }
    cout<<"Done\n";
    fin.close();
    return 0;
}

